package cn.wmw.xyy.web.controller;

import cn.wmw.result.JsonResult;
import cn.wmw.xyy.service.ITokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/token")
public class TokenController {

    @Autowired
    private ITokenService tokenService;

    /**
     * 获取对象
     */
    @RequestMapping(value = "/{courseId}",method = RequestMethod.GET)
    public JsonResult getToken(@PathVariable("courseId")Long courseId){
        return JsonResult.success(tokenService.getToken(courseId));
    }
}
